/************************************************************
 * Project Name         [Thinking_In_Java]
 * File Name            [HelpMenu.java]
 * Creation Date        [11-Jul-2014]
 * 
 * Copyright© ge.y.yang@gmail.com All Rights Reserved
 * 
 * Work hard, play harder, think big and keep fit
 ************************************************************/
package pkg_02_gui.notepad_V1.ui.help;

import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;

import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.KeyStroke;

/**
 * 帮助菜单
 * 
 * @author 不落的太阳(Sean Yang)
 * @version 1.0
 * @since JDK 6
 * 
 */
public abstract class HelpMenu extends JMenu {

	private static final long serialVersionUID = -7293496941601537179L;

	/** **********************帮助菜单*********************** */
	private JMenuItem helpTopicItem; // 帮助主题菜单项
	private JMenuItem aboutItem; // 关于菜单项

	/**
	 * 初始化帮助菜单
	 * 
	 * @param menuName
	 */
	private void initHelpMenu() {
		// 帮助菜单项
		this.setMnemonic(KeyEvent.VK_H); // 设置快捷键为Alt+H

		helpTopicItem = new JMenuItem("帮助主题(H)"); // 帮助主题菜单项
		helpTopicItem.setMnemonic('H'); // 设置激活键为H
		helpTopicItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1,
				InputEvent.CTRL_MASK));// 设置快捷键为Ctrl+F1
		this.add(helpTopicItem);

		aboutItem = new JMenuItem("关于(A)"); // 帮助主题菜单项
		aboutItem.setMnemonic('A'); // 设置激活键为A
		this.add(aboutItem);
	}

	public HelpMenu() {

	}

	public HelpMenu(String menuName) {
		super(menuName);
		initHelpMenu();
	}

	public JMenuItem getHelpTopicItem() {
		return helpTopicItem;
	}

	public JMenuItem getAboutItem() {
		return aboutItem;
	}

}
